\(\int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx\) [18]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 53 \[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=\frac {a \text {arctanh}(\cos (x))}{b^2}+\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {(b-a \cot (x)) \sin (x)}{\sqrt {a^2+b^2}}\right )}{b^2}-\frac {\csc (x)}{b} \]

[Out]

a*arctanh(cos(x))/b^2-csc(x)/b+arctanh((b-a*cot(x))*sin(x)/(a^2+b^2)^(1/2))*(a^2+b^2)^(1/2)/b^2

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3591, 3567, 3855, 3590, 212} \[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sin (x) (b-a \cot (x))}{\sqrt {a^2+b^2}}\right )}{b^2}+\frac {a \text {arctanh}(\cos (x))}{b^2}-\frac {\csc (x)}{b} \]

[In]

Int[Csc[x]^3/(a + b*Cot[x]),x]

[Out]

(a*ArcTanh[Cos[x]])/b^2 + (Sqrt[a^2 + b^2]*ArcTanh[((b - a*Cot[x])*Sin[x])/Sqrt[a^2 + b^2]])/b^2 - Csc[x]/b

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3590

Int[sec[(e_.) + (f_.)*(x_)]/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-f^(-1), Subst[Int[1/(a^
2 + b^2 - x^2), x], x, (b - a*Tan[e + f*x])/Sec[e + f*x]], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0]

Rule 3591

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-d^2/b^2, I
nt[(d*Sec[e + f*x])^(m - 2)*(a - b*Tan[e + f*x]), x], x] + Dist[d^2*((a^2 + b^2)/b^2), Int[(d*Sec[e + f*x])^(m
 - 2)/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f}, x] && NeQ[a^2 + b^2, 0] && IGtQ[m, 1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = -\frac {\int (a-b \cot (x)) \csc (x) \, dx}{b^2}+\frac {\left (a^2+b^2\right ) \int \frac {\csc (x)}{a+b \cot (x)} \, dx}{b^2} \\ & = -\frac {\csc (x)}{b}-\frac {a \int \csc (x) \, dx}{b^2}-\frac {\left (a^2+b^2\right ) \text {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,(-b+a \cot (x)) \sin (x)\right )}{b^2} \\ & = \frac {a \text {arctanh}(\cos (x))}{b^2}+\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {(b-a \cot (x)) \sin (x)}{\sqrt {a^2+b^2}}\right )}{b^2}-\frac {\csc (x)}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.34 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.26 \[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=\frac {2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {-a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )-b \csc (x)+a \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )}{b^2} \]

[In]

Integrate[Csc[x]^3/(a + b*Cot[x]),x]

[Out]

(2*Sqrt[a^2 + b^2]*ArcTanh[(-a + b*Tan[x/2])/Sqrt[a^2 + b^2]] - b*Csc[x] + a*(Log[Cos[x/2]] - Log[Sin[x/2]]))/
b^2

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.53

method result size
default \(-\frac {\tan \left (\frac {x}{2}\right )}{2 b}-\frac {1}{2 b \tan \left (\frac {x}{2}\right )}-\frac {a \ln \left (\tan \left (\frac {x}{2}\right )\right )}{b^{2}}+\frac {\left (-4 a^{2}-4 b^{2}\right ) \operatorname {arctanh}\left (\frac {-2 b \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {a^{2}+b^{2}}}\right )}{2 b^{2} \sqrt {a^{2}+b^{2}}}\) \(81\)
risch \(-\frac {2 i {\mathrm e}^{i x}}{b \left ({\mathrm e}^{2 i x}-1\right )}-\frac {a \ln \left ({\mathrm e}^{i x}-1\right )}{b^{2}}+\frac {a \ln \left ({\mathrm e}^{i x}+1\right )}{b^{2}}-\frac {i \sqrt {-a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i x}+\frac {\left (i a +b \right ) \sqrt {-a^{2}-b^{2}}}{a^{2}+b^{2}}\right )}{b^{2}}+\frac {i \sqrt {-a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i x}-\frac {\left (i a +b \right ) \sqrt {-a^{2}-b^{2}}}{a^{2}+b^{2}}\right )}{b^{2}}\) \(160\)

[In]

int(csc(x)^3/(a+b*cot(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2*tan(1/2*x)/b-1/2/b/tan(1/2*x)-1/b^2*a*ln(tan(1/2*x))+1/2*(-4*a^2-4*b^2)/b^2/(a^2+b^2)^(1/2)*arctanh(1/2*(
-2*b*tan(1/2*x)+2*a)/(a^2+b^2)^(1/2))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 135 vs. \(2 (51) = 102\).

Time = 0.29 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.55 \[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=\frac {a \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) - a \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) + \sqrt {a^{2} + b^{2}} \log \left (-\frac {2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - 2 \, b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (a \cos \left (x\right ) - b \sin \left (x\right )\right )}}{2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}}\right ) \sin \left (x\right ) - 2 \, b}{2 \, b^{2} \sin \left (x\right )} \]

[In]

integrate(csc(x)^3/(a+b*cot(x)),x, algorithm="fricas")

[Out]

1/2*(a*log(1/2*cos(x) + 1/2)*sin(x) - a*log(-1/2*cos(x) + 1/2)*sin(x) + sqrt(a^2 + b^2)*log(-(2*a*b*cos(x)*sin
(x) - (a^2 - b^2)*cos(x)^2 - a^2 - 2*b^2 + 2*sqrt(a^2 + b^2)*(a*cos(x) - b*sin(x)))/(2*a*b*cos(x)*sin(x) - (a^
2 - b^2)*cos(x)^2 + a^2))*sin(x) - 2*b)/(b^2*sin(x))

Sympy [F]

\[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=\int \frac {\csc ^{3}{\left (x \right )}}{a + b \cot {\left (x \right )}}\, dx \]

[In]

integrate(csc(x)**3/(a+b*cot(x)),x)

[Out]

Integral(csc(x)**3/(a + b*cot(x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 107 vs. \(2 (51) = 102\).

Time = 0.30 (sec) , antiderivative size = 107, normalized size of antiderivative = 2.02 \[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=-\frac {a \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{b^{2}} - \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {a - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {a^{2} + b^{2}}}{a - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{b^{2}} - \frac {\cos \left (x\right ) + 1}{2 \, b \sin \left (x\right )} - \frac {\sin \left (x\right )}{2 \, b {\left (\cos \left (x\right ) + 1\right )}} \]

[In]

integrate(csc(x)^3/(a+b*cot(x)),x, algorithm="maxima")

[Out]

-a*log(sin(x)/(cos(x) + 1))/b^2 - sqrt(a^2 + b^2)*log((a - b*sin(x)/(cos(x) + 1) + sqrt(a^2 + b^2))/(a - b*sin
(x)/(cos(x) + 1) - sqrt(a^2 + b^2)))/b^2 - 1/2*(cos(x) + 1)/(b*sin(x)) - 1/2*sin(x)/(b*(cos(x) + 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 108 vs. \(2 (51) = 102\).

Time = 0.28 (sec) , antiderivative size = 108, normalized size of antiderivative = 2.04 \[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=-\frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{b^{2}} - \frac {\tan \left (\frac {1}{2} \, x\right )}{2 \, b} - \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{b^{2}} + \frac {2 \, a \tan \left (\frac {1}{2} \, x\right ) - b}{2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )} \]

[In]

integrate(csc(x)^3/(a+b*cot(x)),x, algorithm="giac")

[Out]

-a*log(abs(tan(1/2*x)))/b^2 - 1/2*tan(1/2*x)/b - sqrt(a^2 + b^2)*log(abs(2*b*tan(1/2*x) - 2*a - 2*sqrt(a^2 + b
^2))/abs(2*b*tan(1/2*x) - 2*a + 2*sqrt(a^2 + b^2)))/b^2 + 1/2*(2*a*tan(1/2*x) - b)/(b^2*tan(1/2*x))

Mupad [B] (verification not implemented)

Time = 12.03 (sec) , antiderivative size = 170, normalized size of antiderivative = 3.21 \[ \int \frac {\csc ^3(x)}{a+b \cot (x)} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {b^3\,\cos \left (\frac {x}{2}\right )\,\sqrt {a^2+b^2}+4\,a^3\,\sin \left (\frac {x}{2}\right )\,\sqrt {a^2+b^2}+3\,a\,b^2\,\sin \left (\frac {x}{2}\right )\,\sqrt {a^2+b^2}+2\,a^2\,b\,\cos \left (\frac {x}{2}\right )\,\sqrt {a^2+b^2}}{4\,\sin \left (\frac {x}{2}\right )\,a^4+2\,\cos \left (\frac {x}{2}\right )\,a^3\,b+5\,\sin \left (\frac {x}{2}\right )\,a^2\,b^2+2\,\cos \left (\frac {x}{2}\right )\,a\,b^3+\sin \left (\frac {x}{2}\right )\,b^4}\right )\,\sqrt {a^2+b^2}}{b^2}-\frac {1}{b\,\sin \left (x\right )}-\frac {a\,\ln \left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )}{b^2} \]

[In]

int(1/(sin(x)^3*(a + b*cot(x))),x)

[Out]

(2*atanh((b^3*cos(x/2)*(a^2 + b^2)^(1/2) + 4*a^3*sin(x/2)*(a^2 + b^2)^(1/2) + 3*a*b^2*sin(x/2)*(a^2 + b^2)^(1/
2) + 2*a^2*b*cos(x/2)*(a^2 + b^2)^(1/2))/(4*a^4*sin(x/2) + b^4*sin(x/2) + 5*a^2*b^2*sin(x/2) + 2*a*b^3*cos(x/2
) + 2*a^3*b*cos(x/2)))*(a^2 + b^2)^(1/2))/b^2 - 1/(b*sin(x)) - (a*log(sin(x/2)/cos(x/2)))/b^2